import { Scene } from "../../../../../Core/Module/Entity/Scene";
import { PingComponent } from "../../../../Model/Client/Demo/Ping/PingComponent";
import { RouterCheckComponent } from "../../../../Model/Client/Demo/Router/RouterCheckComponent";
import { NetClientComponent } from "../../../../Model/Client/Module/Message/NetClientComponent";

export class RouterHelper {

    public static async CreateRouterSession(clientScene: Scene, address: string) {
        let routerSession = await clientScene.GetComponent<NetClientComponent>(NetClientComponent).Create(address);
        routerSession.AddComponent<PingComponent>(PingComponent);
        routerSession.AddComponent<RouterCheckComponent>(RouterCheckComponent);
        return routerSession;
    }

}